#define _CRT_SECURE_NO_WARNINGS
#include "Sort.h"

void Test()
{
	//int arr[] = { 6,1,2,9,4,2,4,1,4,6 };
	//int arr[] = { 100, 101, 109, 105, 101, 105 };
	int arr[] = { 6,1,-1,2,-3,9,4,-1,2,4,-2,1,4,-2,6 };

	PrintArray(arr, sizeof(arr) / sizeof(arr[0]));
	CountSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintArray(arr, sizeof(arr) / sizeof(arr[0]));
}

void Test2()
{
	srand(time(0));
	const int N = 10000000;
	int* a1 = (int*)malloc(sizeof(int) * N);

	for (int i = 0; i < N; ++i)
	{
		a1[i] = rand() + i;
	}
	int begin1 = clock();
	CountSort(a1, N);
	int end1 = clock();

	printf("CountSort:%d\n", end1  - begin1);

	free(a1);
	a1 = NULL;
}

int main()
{
	Test();
	//Test2();
	return 0;
}